import 'package:flutter/material.dart';
import 'package:xinxuan/common/appbar_util.dart';
import 'package:xinxuan/common/button_util.dart';
import 'package:xinxuan/common/scroll_configuration_common.dart';
import 'package:xinxuan/controllers/home_controller/home_page_controller.dart';
import 'package:xinxuan/controllers/my_controller/my_page_controller.dart';
import 'package:xinxuan/router/app_routers.dart';
import 'package:xinxuan/utils/color_util.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class AddPayBankSuccessPage extends StatelessWidget {

  final MyPageController myPageController = Get.find();
  final HomePageController homePageController = Get.find();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarUtil(
        title: '银行卡管理',
        backgroundColor: pageBgColor,
      ),
      body: ScrollConfigurationCommon(child: ListView(
        children: [
          SizedBox(height: 107.h),
          Image.asset(
            'assets/icons/icon_add_pay_bank_success.png',
            width: 166.w,
            height: 115.h,
          ),
          SizedBox(height: 53.h),
          Text(
            '恭喜您！绑定成功！',
            textAlign: TextAlign.center,
            style: TextStyle(
              color: textBlackColor,
              fontSize: 16.sp
            ),
          ),
          SizedBox(height: 88.h),
          Container(
            alignment: Alignment.center,
            child: Container(
              width: 186.w,
              child: ButtonUtil(
                text: '银行卡管理', 
                fontSize: 14.sp, 
                borderRadius: 18.w, 
                height: 36.h, 
                onTop: () {
                  Get.back(result: true);
                }
              ),
            ),
          ),
          Container(
            alignment: Alignment.center,
            margin: EdgeInsets.only(top: 20.h),
            child: Container(
              width: 186.w,
              child: ButtonUtil(
                text: '回到首页', 
                fontSize: 14.sp, 
                borderRadius: 18.w, 
                textColor: mainTextColor,
                bgColors: [
                  bgWhiteColor,
                  bgWhiteColor
                ],
                showBorder: true,
                height: 36.h, 
                onTop: () {
                  myPageController.titleBarOpacity.value = 0.0;
                  Get.offAllNamed(AppRouters.COMMON_PAGE);
                }
              ),
            ),
          )
        ],
      )),
    );
  }
}